using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ForText : MonoBehaviour
{
    public MeshRenderer meshRenderer;
    public int sortingOrder;
    public TextMesh text;
    public static ForText instance;
    private void Awake()
    {
        meshRenderer.sortingOrder = sortingOrder;
        instance = this;
    }
    public void Add(int id, string name)
    {
        text.text += id.ToString() + "." + name + "\n";
    }
    public void Remove(int id, string name)
    {
        text.text = text.text.Replace(id.ToString() + "." + name + "\n", "");
    }
}
